<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class GameRoom extends Model
{
    protected $table = 'game_room';
    protected $primaryKey = 'room_id';
    protected $connection = 'game_server';
    protected $appends = [
        'jeton'
    ];

    protected $fillable = [
        'room_name', 'max', 'min', 'table_count', 'status', 'thumbnail','room_type', 'sort_id', 'enter_limit_max', 'experience_base', 'experience_rate', 'jeton_1', 'jeton_2', 'jeton_3', 'jeton_4', 'jeton_5'
    ];

    //获取押注档次
    public function getJetonAttribute()
    {
        $jeton = [
            $this->attributes['jeton_1'],
            $this->attributes['jeton_2'],
            $this->attributes['jeton_3'],
            $this->attributes['jeton_4'],
            $this->attributes['jeton_5']
        ];

        $jeton = implode(',', $jeton);
        return $jeton;
    }
}
